<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include  file="/jsps/front/common/taglibs.jsp" %>

<!DOCTYPE HTMLPUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
 
    
    <title>顾客 ${loginedCustomer.userName} -的所有订单-</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<c:url value="/js/common.js"/>"></script>
	 <link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/application.css"/>">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->	
	<style>
	* {
		PADDING-RIGHT: 0px;
		PADDING-LEFT: 0px;
		PADDING-BOTTOM: 0px;
		MARGIN: 0px;
		PADDING-TOP: 0px;
	 }
	 
	 
	
	.listable{
	   margin-top:2px;
	   border:1px solid #ffffff;
	   width:100%;
	   font-size:12px;
	}
	
	.listable TD{
	   border-bottom:2px dotted #CCCCCC;
	   height:23px;
	   padding:1px;
	   text-align:center;
	}
	
	.listable Th{
	   height:23px;
	   border-left:1px solid #CCCCCC;
	   text-align:center;
	   background-color:#e4fcff;
	   height:20px;
	}
	
	.linkSpan{
	   color:blue;
	   text-decoration:underline;
	   cursor:hand;
	}
	
	#pageFooter{
		font-size:12px;
		color:#333333;
		text-align:right;
	}
	
	#selectCondition{
		background-color:#cbe6b3;
		font-size:12px;
		color:#000000;
	}
</style>
<script type="text/javascript">
	function changeTrColorMouseOver(obj){
		obj.bgColor="#f4f4f4";
	}
	
	function changeTrColorMouseOut(obj){
		obj.bgColor="white";
	}
	
	 
         function doQuery(pageno)
         {
           if(pageno<1 || pageno>${pagedOrder.totalPageNum})
           {
              alert("页号超出范围，有效范围：[1-${pagedOrder.totalPageNum}]!");
              ${'pageNo'}.select();
              return;
           }
           location.href='<c:url value="/goodMgr?act=orderList"/>&pageNo='+pageno;  
         }
</script>
  </head>
  <body>
   <h3 style="font-size:22px;color:red;">订单查询</h3>
  
    <c:if test="${not empty message}">
	  <script type="text/javascript">
	    alert(${message});
	  </script>
	</c:if>
	
	<div id="search">
	   <form action="<c:url value="/goodMgr?act=orderList"/>" method="post">
	     <span>下单日期:</span>
	     <select name="create_date">
	       <option value="">==请选择==</option>
	       <c:forEach var="date" items="${dateList}">
	         <option value="${date.createDate }" <c:if test="${date.createDate == param.create_date}">selected</c:if>>${date.createDate }</option>
	       </c:forEach>
	     </select>
	     <span>审核状态:</span>
	      <select name ="sign">
	       <option value="">=请选择=</option>
	       <option value="0" <c:if test="${param.sign==0}">selected</c:if>>已提交，未审核</option>
	       <option value="1" <c:if test="${param.sign==1}">selected</c:if>>已审核，未配货</option>
	       <option value="2" <c:if test="${param.sign==2}">selected</c:if>>已配货，未发货</option>
	       <option value="3" <c:if test="${param.sign==3}">selected</c:if>>已发货，未收货</option>
	       <option value="4" <c:if test="${param.sign==4}">selected</c:if>>已收货，交易成功</option>
	      </select>
	      <input type="submit" value=" 查 询 "/>	
	   </form>
	</div>
  
   <div id="container">
	<table cellspacing=0 cellpadding=0 border=0 class="listable">
		<thead >
			<tr>
				<th>&lt;订单号</th>
				<th>收货人</th>
				<th>付款方式</th>
				<th>定单总金额</th>
				<th>定单状态</th>
				<th>下单时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		
			  <c:if test="${not empty pagedOrder}">
			      <c:forEach items="${pagedOrder.pageContent}" var="order">
			  		<tr onMouseOver="changeTrColorMouseOver(this)" onMouseOut="changeTrColorMouseOut(this)">
			  			<td>${order.orderNo}</td>
			  			<td>${order.reallyName}</td>
			  			<td>${order.setMony}</td>
			  			<td>￥ ${order.orderAmount}</td>
			  			<c:choose>
			  				<c:when test="${order.sign==0}">
			  					<td>已提交，未审核</td>
			  				</c:when>
			  				<c:when test="${order.sign==1}">
			  					<td>已审核，未配货</td>
			  				</c:when>
			  				<c:when test="${order.sign==2}">
			  					<td>已配货，未发货</td>
			  				</c:when>
			  				<c:when test="${order.sign==3}">
			  					<td>已发货，未收货</td>
			  				</c:when>
			  				<c:when test="${order.sign==4}">
			  					<td>已收货，交易成功</td>
			  				</c:when>
			  			</c:choose>
			  			
			  			<td>${order.createDate }</td>
			  			
						<td>
							<a href="<c:url value="/goodMgr?act=showDetail&orderNo=${order.orderNo}"/>" >
				  						查看明细
				  					</a>
			  			<c:choose>
			  				<c:when test="${order.sign==0}">
				  					<a href="<c:url value="/goodMgr?act=deleteOrder&orderNo=${order.orderNo}"/>">
				  						撤销
				  					</a>	
			  				</c:when>
			  				<c:when test="${order.sign==3}">
									<a href="<c:url value="/goodMgr?act=OK&orderNo=${order.orderNo}"/>">
					       				货已收到
					       			</a>
			  				</c:when>
			  			</c:choose>
						</td> 
					
			  		</tr>
			  		</c:forEach>
			  </c:if>
			  
			  <c:if test="${empty pagedOrder.pageContent}">
			  		<tr >
			  			<td colspan="8">您当前没有任何定单信息</td>
			  		</tr>
			  </c:if>
		</tbody>
	</table>
	 <div id="pageinfo">
	            共${pagedOrder.totalRecNum}条, 当前显示${pagedOrder.startIndex}-${pagedOrder.endIndex}条 ${pagedOrder.pageNo}/${pagedOrder.totalPageNum}页
	           |
	           <c:if test="${pagedOrder.pageNo>1}">
	             <span class="linkspan" onclick="doQuery(1)">首页</span>&nbsp;
	           </c:if>
	           <c:if test="${pagedOrder.prePage}">
	             <IMG onclick="doQuery(${pagedOrder.pageNo-1});" title="上一页" src="<c:url value="/jsps/front/images/page_up_mouseover.gif" />">&nbsp;
	           </c:if>
	           <c:if test="${pagedOrder.nextPage}">
	              <IMG onclick="doQuery(${pagedOrder.pageNo+1});" title="下一页" src="<c:url value="/jsps/front/images/page_down.gif" />">&nbsp;
	           </c:if>
	           <c:if test="${pagedOrder.pageNo!=pagedOrder.totalPageNum}">
	             <span class="linkspan" onclick="doQuery(${pagedOrder.totalPageNum})">末页</span>&nbsp;
	           </c:if>
	           |
	            到<input type="text" id="pageNo" size=4 style="text-align:right;" onkeypress="onlynumber();"/> 页
	           <button onclick="doQuery(document.getElementById('pageNo').value);"> 跳 转 </button>		           		           	           	              
	   </div>
</div>

</body>
</html>
